// To parse this JSON data, do
//
//     final userInfo = userInfoFromJson(jsonString);

import 'dart:convert';

class UserInfo {
  UserInfo({
    required this.nickName,
    required this.assets,
    required this.isAuthName,
    required this.isSettingPayPassword,
    required this.isVip,
    required this.portrait,
    required this.phone,
    required this.uid,
  });
  String nickName;
  Assets assets;
  bool isAuthName;
  bool isSettingPayPassword;
  bool isVip;
  String portrait;
  String phone;
  int uid;

  factory UserInfo.fromRawJson(String str) => UserInfo.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory UserInfo.fromJson(Map<String, dynamic> json) => UserInfo(
    assets: Assets.fromJson(json["assets"]),
    isAuthName: json["isAuthName"],
    portrait:json["portrait"]??"",
    nickName:json["nickName"],
    isSettingPayPassword: json["isSettingPayPassword"],
    isVip: json["isVip"],
    phone: json["phone"],
    uid: json["uid"],
  );

  Map<String, dynamic> toJson() => {
    "assets": assets.toJson(),
    "isAuthName": isAuthName,
    "nickName": nickName,
    "portrait": portrait,
    "isSettingPayPassword": isSettingPayPassword,
    "isVip": isVip,
    "phone": phone,
    "uid": uid,
  };
}

class Assets {
  Assets({
    required this.balance,
    required this.integral,
    required this.ticket,
  });

  double balance;
  double integral;
  double ticket;

  factory Assets.fromRawJson(String str) => Assets.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory Assets.fromJson(Map<String, dynamic> json) => Assets(
    balance: json["balance"],
    integral: json["integral"],
    ticket: json["ticket"],
  );

  Map<String, dynamic> toJson() => {
    "balance": balance,
    "integral": integral,
    "ticket": ticket,
  };
}
